package day1027.CarRentalCompany;
//子类  客车
public class PassengerCar extends Car{
    public PassengerCar(String type, String brand, String carnumber, int seatnum, double rent, boolean state) {
        super(type, brand, carnumber, seatnum, rent, state);
    }
    public  double calculate(int day){
        double price;
        if (day>=3){
            price = day*getRent()*0.9;
            return price;
        }
        if (day>=7){
            price = day*getRent()*0.8;
            return price;
        }
        if (day>=30){
            price = day*getRent()*0.7;
            return price;
        } if (day>=150){
            price = day*getRent()*0.6;
            return price;
        }
        price = day*getSeatnum();
        return price;
    }
}
